import type { loginType, userInfoType, changePasswordType } from "./type.ts";
import { req } from "_s/boot/axios";
export const userLogin = (data: loginType) => {
  return req.request<ApiResponseData<string>>({
    url: "/user/login",
    method: "post",
    data
  });
};

export const userInfo = () => {
  return req.request<ApiResponseData<userInfoType>>({
    url: "/user/info",
    method: "get"
  });
};

export const changePassword = (data: changePasswordType) => {
  return req.request<ApiResponseData<string>>({
    url: "/user/changePassword",
    data,
    method: "post"
  });
};

export const getUserList = (params: pagination) => {
  return req.request<ApiResponseData<page<userInfoType[]>>>({
    url: "/user/list",
    params,
    method: "get"
  });
};
